Skip to content

feat(react): add useEventStream hook for consuming PerstackEvent streams#453

Merged
FL4TLiN3 merged 1 commit intomainfrom
feat/use-event-stream
Jan 27, 2026
Merged

feat(react): add useEventStream hook for consuming PerstackEvent streams#453
FL4TLiN3 merged 1 commit intomainfrom
feat/use-event-stream

Conversation

@FL4TLiN3
Copy link
Contributor

Summary

  • Add useEventStream hook that provides automatic connection management for PerstackEvent streams
  • The hook is API-agnostic and accepts an EventSourceFactory function
  • Uses useRun hook internally for event processing

Features

  • Automatic connection lifecycle management (connect/disconnect based on enabled flag)
  • Event processing through useRun hook internally
  • Connection state tracking (isConnected, error)
  • Proper cleanup on unmount or when disabled
  • AbortSignal support for stream cancellation

Test plan

  • Unit tests for all hook functionality
  • Build verification
  • Type check verification

🤖 Generated with Claude Code

@FL4TLiN3 FL4TLiN3 force-pushed the feat/use-event-stream branch from 47a7abd to ca89349 Compare January 27, 2026 20:22
Add a new useEventStream hook that provides automatic connection management
for PerstackEvent streams. The hook is API-agnostic and accepts an
EventSourceFactory function, allowing it to work with any backend.

Features:
- Automatic connection lifecycle management
- Event processing through useRun hook internally
- Connection state tracking (isConnected, error)
- Proper cleanup on unmount or when disabled
- AbortSignal support for stream cancellation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@FL4TLiN3 FL4TLiN3 force-pushed the feat/use-event-stream branch from ca89349 to b549acf Compare January 27, 2026 20:26
@FL4TLiN3 FL4TLiN3 merged commit 9d4d713 into main Jan 27, 2026
9 checks passed
@FL4TLiN3 FL4TLiN3 deleted the feat/use-event-stream branch February 25, 2026 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant